Pulse-width modulation (PWM) is a technique that is used to encode data into a pulsing signal. PWM can be used, for example, to encode data for transmission or to control the power supplied to electrical devices, such as integrated circuits or motors. A voltage regulator may use PWM to control a voltage and a current provided to a load by turning a switch that is coupled between an input voltage source and the load on and off. The duration of time that the switch is on in each switching period of the switch determines the total power supplied to the load.